<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>伪元素清除浮动</title>
    <style lang="less">
        .clearfix::after {
            content: "";
            display: block;
            height: 0;
            clear: both;
            visibility: hidden;
        }

        /* .clearfix {
            *zoom: 1;
        } */

        .box {
            width: 200px;
            background-color: pink;
            /* overflow: hidden; */
            /* 可以合并外边距也可以清除浮动带来的影响 */
        }

        .box .damao {
            width: 30px;
            height: 50px;
            background-color: aqua;
            float: left;
        }

        .box .ermao {
            width: 40px;
            height: 80px;
            background-color: aquamarine;
            float: left;
        }

        .footer {
            height: 300px;
            background-color: black;
        }
    </style>
</head>

<body>
    <div class="box clearfix">
        <div class="damao">1</div>
        <div class="ermao">2</div>
        <!-- <div class="clear"></div>
        必须用块级元素来表示，不能用行内元素表示 -->
    </div>
    <div class="footer"></div>
</body>

</html>